\(\int x^2 \log (c (a+\frac {b}{x^2})^p) \, dx\) [38]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 58 \[ \int x^2 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \, dx=\frac {2 b p x}{3 a}-\frac {2 b^{3/2} p \arctan \left (\frac {\sqrt {a} x}{\sqrt {b}}\right )}{3 a^{3/2}}+\frac {1}{3} x^3 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \]

[Out]

2/3*b*p*x/a-2/3*b^(3/2)*p*arctan(x*a^(1/2)/b^(1/2))/a^(3/2)+1/3*x^3*ln(c*(a+b/x^2)^p)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {2505, 199, 327, 211} \[ \int x^2 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \, dx=-\frac {2 b^{3/2} p \arctan \left (\frac {\sqrt {a} x}{\sqrt {b}}\right )}{3 a^{3/2}}+\frac {1}{3} x^3 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right )+\frac {2 b p x}{3 a} \]

[In]

Int[x^2*Log[c*(a + b/x^2)^p],x]

[Out]

(2*b*p*x)/(3*a) - (2*b^(3/2)*p*ArcTan[(Sqrt[a]*x)/Sqrt[b]])/(3*a^(3/2)) + (x^3*Log[c*(a + b/x^2)^p])/3

Rule 199

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[x^(n*p)*(b + a/x^n)^p, x] /; FreeQ[{a, b}, x] && LtQ[n, 0]
 && IntegerQ[p]

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2505

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))*((f_.)*(x_))^(m_.), x_Symbol] :> Simp[(f*x)^(m +
 1)*((a + b*Log[c*(d + e*x^n)^p])/(f*(m + 1))), x] - Dist[b*e*n*(p/(f*(m + 1))), Int[x^(n - 1)*((f*x)^(m + 1)/
(d + e*x^n)), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && NeQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{3} x^3 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right )+\frac {1}{3} (2 b p) \int \frac {1}{a+\frac {b}{x^2}} \, dx \\ & = \frac {1}{3} x^3 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right )+\frac {1}{3} (2 b p) \int \frac {x^2}{b+a x^2} \, dx \\ & = \frac {2 b p x}{3 a}+\frac {1}{3} x^3 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right )-\frac {\left (2 b^2 p\right ) \int \frac {1}{b+a x^2} \, dx}{3 a} \\ & = \frac {2 b p x}{3 a}-\frac {2 b^{3/2} p \tan ^{-1}\left (\frac {\sqrt {a} x}{\sqrt {b}}\right )}{3 a^{3/2}}+\frac {1}{3} x^3 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.00 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.81 \[ \int x^2 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \, dx=\frac {2 b p x \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\frac {b}{a x^2}\right )}{3 a}+\frac {1}{3} x^3 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \]

[In]

Integrate[x^2*Log[c*(a + b/x^2)^p],x]

[Out]

(2*b*p*x*Hypergeometric2F1[-1/2, 1, 1/2, -(b/(a*x^2))])/(3*a) + (x^3*Log[c*(a + b/x^2)^p])/3

Maple [A] (verified)

Time = 0.26 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.84

method result size
parts \(\frac {x^{3} \ln \left (c \left (a +\frac {b}{x^{2}}\right )^{p}\right )}{3}+\frac {2 p b \left (\frac {x}{a}-\frac {b \arctan \left (\frac {a x}{\sqrt {a b}}\right )}{a \sqrt {a b}}\right )}{3}\) \(49\)

[In]

int(x^2*ln(c*(a+b/x^2)^p),x,method=_RETURNVERBOSE)

[Out]

1/3*x^3*ln(c*(a+b/x^2)^p)+2/3*p*b*(x/a-1/a*b/(a*b)^(1/2)*arctan(a*x/(a*b)^(1/2)))

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 141, normalized size of antiderivative = 2.43 \[ \int x^2 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \, dx=\left [\frac {a p x^{3} \log \left (\frac {a x^{2} + b}{x^{2}}\right ) + a x^{3} \log \left (c\right ) + b p \sqrt {-\frac {b}{a}} \log \left (\frac {a x^{2} - 2 \, a x \sqrt {-\frac {b}{a}} - b}{a x^{2} + b}\right ) + 2 \, b p x}{3 \, a}, \frac {a p x^{3} \log \left (\frac {a x^{2} + b}{x^{2}}\right ) + a x^{3} \log \left (c\right ) - 2 \, b p \sqrt {\frac {b}{a}} \arctan \left (\frac {a x \sqrt {\frac {b}{a}}}{b}\right ) + 2 \, b p x}{3 \, a}\right ] \]

[In]

integrate(x^2*log(c*(a+b/x^2)^p),x, algorithm="fricas")

[Out]

[1/3*(a*p*x^3*log((a*x^2 + b)/x^2) + a*x^3*log(c) + b*p*sqrt(-b/a)*log((a*x^2 - 2*a*x*sqrt(-b/a) - b)/(a*x^2 +
 b)) + 2*b*p*x)/a, 1/3*(a*p*x^3*log((a*x^2 + b)/x^2) + a*x^3*log(c) - 2*b*p*sqrt(b/a)*arctan(a*x*sqrt(b/a)/b)
+ 2*b*p*x)/a]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 133 vs. \(2 (54) = 108\).

Time = 11.20 (sec) , antiderivative size = 133, normalized size of antiderivative = 2.29 \[ \int x^2 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \, dx=\begin {cases} \frac {x^{3} \log {\left (0^{p} c \right )}}{3} & \text {for}\: a = 0 \wedge b = 0 \\\frac {2 p x^{3}}{9} + \frac {x^{3} \log {\left (c \left (\frac {b}{x^{2}}\right )^{p} \right )}}{3} & \text {for}\: a = 0 \\\frac {x^{3} \log {\left (a^{p} c \right )}}{3} & \text {for}\: b = 0 \\\frac {x^{3} \log {\left (c \left (a + \frac {b}{x^{2}}\right )^{p} \right )}}{3} + \frac {2 b p x}{3 a} - \frac {b^{2} p \log {\left (x - \sqrt {- \frac {b}{a}} \right )}}{3 a^{2} \sqrt {- \frac {b}{a}}} + \frac {b^{2} p \log {\left (x + \sqrt {- \frac {b}{a}} \right )}}{3 a^{2} \sqrt {- \frac {b}{a}}} & \text {otherwise} \end {cases} \]

[In]

integrate(x**2*ln(c*(a+b/x**2)**p),x)

[Out]

Piecewise((x**3*log(0**p*c)/3, Eq(a, 0) & Eq(b, 0)), (2*p*x**3/9 + x**3*log(c*(b/x**2)**p)/3, Eq(a, 0)), (x**3
*log(a**p*c)/3, Eq(b, 0)), (x**3*log(c*(a + b/x**2)**p)/3 + 2*b*p*x/(3*a) - b**2*p*log(x - sqrt(-b/a))/(3*a**2
*sqrt(-b/a)) + b**2*p*log(x + sqrt(-b/a))/(3*a**2*sqrt(-b/a)), True))

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.83 \[ \int x^2 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \, dx=\frac {1}{3} \, x^{3} \log \left ({\left (a + \frac {b}{x^{2}}\right )}^{p} c\right ) - \frac {2}{3} \, b p {\left (\frac {b \arctan \left (\frac {a x}{\sqrt {a b}}\right )}{\sqrt {a b} a} - \frac {x}{a}\right )} \]

[In]

integrate(x^2*log(c*(a+b/x^2)^p),x, algorithm="maxima")

[Out]

1/3*x^3*log((a + b/x^2)^p*c) - 2/3*b*p*(b*arctan(a*x/sqrt(a*b))/(sqrt(a*b)*a) - x/a)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.09 \[ \int x^2 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \, dx=\frac {1}{3} \, p x^{3} \log \left (a x^{2} + b\right ) - \frac {1}{3} \, p x^{3} \log \left (x^{2}\right ) + \frac {1}{3} \, x^{3} \log \left (c\right ) - \frac {2 \, b^{2} p \arctan \left (\frac {a x}{\sqrt {a b}}\right )}{3 \, \sqrt {a b} a} + \frac {2 \, b p x}{3 \, a} \]

[In]

integrate(x^2*log(c*(a+b/x^2)^p),x, algorithm="giac")

[Out]

1/3*p*x^3*log(a*x^2 + b) - 1/3*p*x^3*log(x^2) + 1/3*x^3*log(c) - 2/3*b^2*p*arctan(a*x/sqrt(a*b))/(sqrt(a*b)*a)
 + 2/3*b*p*x/a

Mupad [B] (verification not implemented)

Time = 1.33 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.76 \[ \int x^2 \log \left (c \left (a+\frac {b}{x^2}\right )^p\right ) \, dx=\frac {x^3\,\ln \left (c\,{\left (a+\frac {b}{x^2}\right )}^p\right )}{3}-\frac {2\,b^{3/2}\,p\,\mathrm {atan}\left (\frac {\sqrt {a}\,x}{\sqrt {b}}\right )}{3\,a^{3/2}}+\frac {2\,b\,p\,x}{3\,a} \]

[In]

int(x^2*log(c*(a + b/x^2)^p),x)

[Out]

(x^3*log(c*(a + b/x^2)^p))/3 - (2*b^(3/2)*p*atan((a^(1/2)*x)/b^(1/2)))/(3*a^(3/2)) + (2*b*p*x)/(3*a)